package com.yungu.swift.common.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.yungu.swift.base.ResponseData;
import com.yungu.swift.base.mapper.IMapper;
import com.yungu.swift.base.service.impl.BaseServiceImpl;
import com.yungu.swift.common.dao.CommonDictionaryMapper;
import com.yungu.swift.common.model.dto.CommonDictionaryDto;
import com.yungu.swift.common.model.param.CommonDictionaryParam;
import com.yungu.swift.common.model.vo.EvaluationItemVo;
import com.yungu.swift.common.service.CommonDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description: 数据字典明细信息
 */
@Service
public class CommonDictionaryServiceImpl extends BaseServiceImpl<CommonDictionaryDto> implements CommonDictionaryService {

    @Autowired
    private CommonDictionaryMapper commonDictionaryMapper;

    @Override
    protected IMapper<CommonDictionaryDto> getMapper() {
        return commonDictionaryMapper;
    }

    @Override
    public ResponseData<List<EvaluationItemVo>> queryDictionaryInfo(CommonDictionaryParam commonDictionaryParam) {
        Map<String, Object> paraMap = new HashMap<>();
        paraMap.put("dictKey", commonDictionaryParam.getDictKey());
        return ResponseData.buildSuccessResponse(commonDictionaryMapper.queryDictionaryInfo(paraMap));
    }
}